import time
from utils import time_utils

IMAGES_BUCKET_NAME = 1
VIDEOS_BUCKET_NAME = 2
AUDIOS_BUCKET_NAME = 3
SHORT_VIDEOS_BUCKET_NAME = 4

I_PNG = '.png'
I_JPG = '.jpg'

V_MP4 = '.mp4'
V_AVI = '.avi'

A_MP3 = '.mp3'


def get_buket_name(chapter_id, user_id,  type):
    if type == IMAGES_BUCKET_NAME:
        return 'imgs' + '-' + str(user_id) + '-' + str(chapter_id)
    elif type == VIDEOS_BUCKET_NAME:
        return 'videos' + '-' + str(user_id) + '-' + str(chapter_id)
    elif type == AUDIOS_BUCKET_NAME:
        return 'audios' + '-' + str(user_id) + '-' + str(chapter_id)
    elif type == SHORT_VIDEOS_BUCKET_NAME:
        return 'short-videos' + '-' + str(user_id) + '-' + str(chapter_id) + '-' + time_utils.get_current_timestamp()

def get_file_name(chapter_id, user_id, file_suffix):
    return str(user_id) + '-' + str(chapter_id) + '-' + str(time.time()) + file_suffix